load("@rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "ppsutil",
    srcs = [
        "decoder.go",
        "util.go",
    ],
    importpath = "github.com/pachyderm/pachyderm/v2/src/internal/ppsutil",
    visibility = ["//src:__subpackages__"],
    deps = [
        "//src/auth",
        "//src/constants",
        "//src/internal/client",
        "//src/internal/collection",
        "//src/internal/dbutil",
        "//src/internal/errors",
        "//src/internal/errutil",
        "//src/internal/log",
        "//src/internal/pachsql",
        "//src/internal/pfsutil",
        "//src/internal/ppsdb",
        "//src/internal/tracing",
        "//src/internal/transactionenv",
        "//src/internal/transactionenv/txncontext",
        "//src/pfs",
        "//src/pps",
        "//src/server/pfs",
        "//src/server/pps",
        "//src/server/worker/common",
        "@in_gopkg_yaml_v3//:yaml_v3",
        "@io_k8s_api//core/v1:core",
        "@io_k8s_apimachinery//pkg/api/resource",
        "@org_golang_google_protobuf//encoding/protojson",
        "@org_golang_google_protobuf//proto",
        "@org_golang_google_protobuf//types/known/timestamppb",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "ppsutil_test",
    size = "small",
    srcs = [
        "decoder_internal_test.go",
        "decoder_test.go",
        "util_test.go",
    ],
    embed = [":ppsutil"],
    deps = [
        "//src/constants",
        "//src/internal/errors",
        "//src/pfs",
        "//src/pps",
        "@in_gopkg_yaml_v3//:yaml_v3",
        "@org_golang_google_protobuf//encoding/protojson",
    ],
)
